Package-level declarations

Types

Link copied to clipboard
@Serializable
sealed class BackgroundFill

This object describes the way a background is filled based on the selected colors. Currently, it can be one of

Link copied to clipboard
@Serializable
sealed class BackgroundType

This object describes the type of a background. Currently, it can be one of

Link copied to clipboard
@Serializable
data class Birthdate(val day: Int, val month: Int, val year: Int? = null)

Describes the birthdate of a user.

Link copied to clipboard
@Serializable
data class CallbackQuery(val id: String, val from: User, val message: MaybeInaccessibleMessage? = null, val inlineMessageId: String? = null, val chatInstance: String, val data: String? = null, val gameShortName: String? = null)

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

Link copied to clipboard
@Serializable
data class Contact(val phoneNumber: String, val firstName: String, val lastName: String? = null, val userId: Long? = null, val vcard: String? = null)

This object represents a phone contact.

Link copied to clipboard
@Serializable
enum EmojiType : Enum<EmojiType>
Link copied to clipboard
@Serializable
data class ExternalReplyInfo(val origin: MessageOrigin, val chat: Chat? = null, val messageId: Long? = null, val linkPreviewOptions: LinkPreviewOptions? = null, val animation: Animation? = null, val audio: Audio? = null, val document: Document? = null, val paidMedia: PaidMediaInfo? = null, val photo: List<PhotoSize>? = null, val sticker: Sticker? = null, val story: Story? = null, val video: Video? = null, val videoNote: VideoNote? = null, val voice: Voice? = null, val hasMediaSpoiler: Boolean? = null, val contact: Contact? = null, val dice: Dice? = null, val game: Game? = null, val giveaway: Giveaway? = null, val giveawayWinners: GiveawayWinners? = null, val invoice: Invoice? = null, val location: Location? = null, val poll: Poll? = null, val venue: Venue? = null)

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

Link copied to clipboard
@Serializable
sealed class InputMessageContent

This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

Link copied to clipboard
@Serializable
data class LinkPreviewOptions(var isDisabled: Boolean? = null, var url: String? = null, var preferSmallMedia: Boolean? = null, var preferLargeMedia: Boolean? = null, var showAboveText: Boolean? = null)

Describes the options used for link preview generation.

Link copied to clipboard
@Serializable
data class Location(val longitude: Float, val latitude: Float, val horizontalAccuracy: Float? = null, val livePeriod: Int? = null, val heading: Int? = null, val proximityAlertRadius: Int? = null)

This object represents a point on the map.

Link copied to clipboard
@Serializable
enum ParseMode : Enum<ParseMode>
Link copied to clipboard
@Serializable
data class PollAnswer(val pollId: String, val voterChat: Chat? = null, val user: User? = null, val optionIds: List<Int>)

This object represents an answer of a user in a non-anonymous poll.

Link copied to clipboard
@Serializable
data class ProximityAlertTriggered(val traveler: User, val watcher: User, val distance: Int)

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

Link copied to clipboard
@Serializable
data class ReactionCount(val type: ReactionType, val totalCount: Int)

Represents a reaction added to a message along with the number of times it was added.

Link copied to clipboard
@Serializable
sealed class ReactionType

This object describes the type of a reaction. Currently, it can be one of

Link copied to clipboard
@Serializable
data class ReplyParameters(var messageId: Long, var chatId: Identifier? = null, var allowSendingWithoutReply: Boolean? = null, var quote: String? = null, var quoteParseMode: String? = null, var quoteEntities: List<MessageEntity>? = null, var quotePosition: Int? = null)

Describes reply parameters for the message that is being sent.

Link copied to clipboard
@Serializable
data class ResponseParameters(val migrateToChatId: Long? = null, val retryAfter: Int? = null)

Describes why a request was unsuccessful.

Link copied to clipboard
@Serializable
data class SentWebAppMessage(val inlineMessageId: String? = null)

Describes an inline message sent by a Web App on behalf of a user.

Link copied to clipboard
@Serializable
data class SharedUser(val userId: Long, val firstName: String? = null, val lastName: String? = null, val username: String? = null, val photo: List<PhotoSize>? = null)

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

Link copied to clipboard
@Serializable
data class TextQuote(val text: String, val entities: List<MessageEntity>? = null, val position: Int, val isManual: Boolean? = null)

This object contains information about the quoted part of a message that is replied to by the given message.

Link copied to clipboard
@Serializable
data class Update(val updateId: Int, val message: Message? = null, val editedMessage: Message? = null, val channelPost: Message? = null, val editedChannelPost: Message? = null, val businessConnection: BusinessConnection? = null, val businessMessage: Message? = null, val editedBusinessMessage: Message? = null, val deletedBusinessMessages: BusinessMessagesDeleted? = null, val messageReaction: MessageReactionUpdated? = null, val messageReactionCount: MessageReactionCountUpdated? = null, val inlineQuery: InlineQuery? = null, val chosenInlineResult: ChosenInlineResult? = null, val callbackQuery: CallbackQuery? = null, val shippingQuery: ShippingQuery? = null, val preCheckoutQuery: PreCheckoutQuery? = null, val purchasedPaidMedia: PaidMediaPurchased? = null, val poll: Poll? = null, val pollAnswer: PollAnswer? = null, val myChatMember: ChatMemberUpdated? = null, val chatMember: ChatMemberUpdated? = null, val chatJoinRequest: ChatJoinRequest? = null, val chatBoost: ChatBoostUpdated? = null, val removedChatBoost: ChatBoostRemoved? = null) : MultipleResponse

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Link copied to clipboard
@Serializable
data class User(val id: Long, val isBot: Boolean, val firstName: String, val lastName: String? = null, val username: String? = null, val languageCode: String? = null, val isPremium: Boolean? = null, val addedToAttachmentMenu: Boolean? = null, val canJoinGroups: Boolean? = null, val canReadAllGroupMessages: Boolean? = null, val supportsInlineQueries: Boolean? = null, val canConnectToBusiness: Boolean? = null, val hasMainWebApp: Boolean? = null) : IdLong

This object represents a Telegram user or bot.

Link copied to clipboard
@Serializable
data class UserProfilePhotos(val totalCount: Int, val photos: List<List<PhotoSize>>)

This object represent a user's profile pictures.

Link copied to clipboard
@Serializable
data class UsersShared(val requestId: Int, val users: List<SharedUser>)

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

Link copied to clipboard
@Serializable
data class Venue(val location: Location, val title: String, val address: String, val foursquareId: String? = null, val foursquareType: String? = null, val googlePlaceId: String? = null, val googlePlaceType: String? = null)

This object represents a venue.

Link copied to clipboard
@Serializable
data class WebhookInfo(val url: String, val hasCustomCertificate: Boolean, val pendingUpdateCount: Int, val ipAddress: String? = null, val lastErrorDate: Instant? = null, val lastErrorMessage: String? = null, val lastSynchronizationErrorDate: Instant? = null, val maxConnections: Int? = null, val allowedUpdates: List<UpdateType>? = null)

Describes the current status of a webhook.

Link copied to clipboard
@Serializable
data class WriteAccessAllowed(val fromRequest: Boolean? = null, val fromAttachmentMenu: Boolean? = null, val webAppName: String? = null)

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess.